# -*- coding: utf-8 -*-

import unittest
from ddt import ddt, file_data
from crm.base.crm_use_browser import UseBrowser
from crm.webpage.login_page import LoginPage

@ddt
class TestLoginError(unittest.TestCase):

    # 前置条件
    def setUp(self) -> None:
        self.lp = LoginPage()

    # 用户名/密码各为空、错误,3个case
    @file_data('../../config/Login_error.yaml')
    def test_2_login_error(self, **data):
        self.lp.login(data['username'], data['password'])
        self.assertIn(data['expect_value'], self.lp.login_error_info())

    # 退出
    def tearDown(self) -> None:
        UseBrowser.driver.quit()


if __name__ == '__main__':
    unittest.main()
